import 'package:safetymonitor/generated/json/base/json_convert_content.dart';
import 'package:safetymonitor/app/data/entities/home/duty/schdule_info_create_entity.dart';

SchduleInfoCreateEntity $SchduleInfoCreateEntityFromJson(Map<String, dynamic> json) {
  final SchduleInfoCreateEntity schduleInfoCreateEntity = SchduleInfoCreateEntity();
  final int? dutyType = jsonConvert.convert<int>(json['dutyType']);
  if (dutyType != null) {
    schduleInfoCreateEntity.dutyType = dutyType;
  }
  final int? scheduleConfigId = jsonConvert.convert<int>(json['scheduleConfigId']);
  if (scheduleConfigId != null) {
    schduleInfoCreateEntity.scheduleConfigId = scheduleConfigId;
  }
  final String? dutyRoomLandline = jsonConvert.convert<String>(json['dutyRoomLandline']);
  if (dutyRoomLandline != null) {
    schduleInfoCreateEntity.dutyRoomLandline = dutyRoomLandline;
  }
  final String? scheduleName = jsonConvert.convert<String>(json['scheduleName']);
  if (scheduleName != null) {
    schduleInfoCreateEntity.scheduleName = scheduleName;
  }
  final String? dutyStartDate = jsonConvert.convert<String>(json['dutyStartDate']);
  if (dutyStartDate != null) {
    schduleInfoCreateEntity.dutyStartDate = dutyStartDate;
  }
  final String? dutyEndDate = jsonConvert.convert<String>(json['dutyEndDate']);
  if (dutyEndDate != null) {
    schduleInfoCreateEntity.dutyEndDate = dutyEndDate;
  }
  final int? dutyPersonId = jsonConvert.convert<int>(json['dutyPersonId']);
  if (dutyPersonId != null) {
    schduleInfoCreateEntity.dutyPersonId = dutyPersonId;
  }
  final String? dutyPerson = jsonConvert.convert<String>(json['dutyPerson']);
  if (dutyPerson != null) {
    schduleInfoCreateEntity.dutyPerson = dutyPerson;
  }
  final dynamic personScheduleType = json['personScheduleType'];
  if (personScheduleType != null) {
    schduleInfoCreateEntity.personScheduleType = personScheduleType;
  }
  final String? personScheduleTypeCode = jsonConvert.convert<String>(json['personScheduleTypeCode']);
  if (personScheduleTypeCode != null) {
    schduleInfoCreateEntity.personScheduleTypeCode = personScheduleTypeCode;
  }
  final String? dutyPersonPhone = jsonConvert.convert<String>(json['dutyPersonPhone']);
  if (dutyPersonPhone != null) {
    schduleInfoCreateEntity.dutyPersonPhone = dutyPersonPhone;
  }
  final int? dutyLeaderId = jsonConvert.convert<int>(json['dutyLeaderId']);
  if (dutyLeaderId != null) {
    schduleInfoCreateEntity.dutyLeaderId = dutyLeaderId;
  }
  final String? dutyLeader = jsonConvert.convert<String>(json['dutyLeader']);
  if (dutyLeader != null) {
    schduleInfoCreateEntity.dutyLeader = dutyLeader;
  }
  final dynamic leaderScheduleType = json['leaderScheduleType'];
  if (leaderScheduleType != null) {
    schduleInfoCreateEntity.leaderScheduleType = leaderScheduleType;
  }
  final String? leaderScheduleTypeCode = jsonConvert.convert<String>(json['leaderScheduleTypeCode']);
  if (leaderScheduleTypeCode != null) {
    schduleInfoCreateEntity.leaderScheduleTypeCode = leaderScheduleTypeCode;
  }
  final String? dutyLeaderPhone = jsonConvert.convert<String>(json['dutyLeaderPhone']);
  if (dutyLeaderPhone != null) {
    schduleInfoCreateEntity.dutyLeaderPhone = dutyLeaderPhone;
  }
  return schduleInfoCreateEntity;
}

Map<String, dynamic> $SchduleInfoCreateEntityToJson(SchduleInfoCreateEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['dutyType'] = entity.dutyType;
  data['scheduleConfigId'] = entity.scheduleConfigId;
  data['dutyRoomLandline'] = entity.dutyRoomLandline;
  data['scheduleName'] = entity.scheduleName;
  data['dutyStartDate'] = entity.dutyStartDate;
  data['dutyEndDate'] = entity.dutyEndDate;
  data['dutyPersonId'] = entity.dutyPersonId;
  data['dutyPerson'] = entity.dutyPerson;
  data['personScheduleType'] = entity.personScheduleType;
  data['personScheduleTypeCode'] = entity.personScheduleTypeCode;
  data['dutyPersonPhone'] = entity.dutyPersonPhone;
  data['dutyLeaderId'] = entity.dutyLeaderId;
  data['dutyLeader'] = entity.dutyLeader;
  data['leaderScheduleType'] = entity.leaderScheduleType;
  data['leaderScheduleTypeCode'] = entity.leaderScheduleTypeCode;
  data['dutyLeaderPhone'] = entity.dutyLeaderPhone;
  return data;
}

extension SchduleInfoCreateEntityExtension on SchduleInfoCreateEntity {
  SchduleInfoCreateEntity copyWith({
    int? dutyType,
    int? scheduleConfigId,
    String? dutyRoomLandline,
    String? scheduleName,
    String? dutyStartDate,
    String? dutyEndDate,
    int? dutyPersonId,
    String? dutyPerson,
    dynamic personScheduleType,
    String? personScheduleTypeCode,
    String? dutyPersonPhone,
    int? dutyLeaderId,
    String? dutyLeader,
    dynamic leaderScheduleType,
    String? leaderScheduleTypeCode,
    String? dutyLeaderPhone,
  }) {
    return SchduleInfoCreateEntity()
      ..dutyType = dutyType ?? this.dutyType
      ..scheduleConfigId = scheduleConfigId ?? this.scheduleConfigId
      ..dutyRoomLandline = dutyRoomLandline ?? this.dutyRoomLandline
      ..scheduleName = scheduleName ?? this.scheduleName
      ..dutyStartDate = dutyStartDate ?? this.dutyStartDate
      ..dutyEndDate = dutyEndDate ?? this.dutyEndDate
      ..dutyPersonId = dutyPersonId ?? this.dutyPersonId
      ..dutyPerson = dutyPerson ?? this.dutyPerson
      ..personScheduleType = personScheduleType ?? this.personScheduleType
      ..personScheduleTypeCode = personScheduleTypeCode ?? this.personScheduleTypeCode
      ..dutyPersonPhone = dutyPersonPhone ?? this.dutyPersonPhone
      ..dutyLeaderId = dutyLeaderId ?? this.dutyLeaderId
      ..dutyLeader = dutyLeader ?? this.dutyLeader
      ..leaderScheduleType = leaderScheduleType ?? this.leaderScheduleType
      ..leaderScheduleTypeCode = leaderScheduleTypeCode ?? this.leaderScheduleTypeCode
      ..dutyLeaderPhone = dutyLeaderPhone ?? this.dutyLeaderPhone;
  }
}